package com.ecco.persistent;

import java.util.Date;
import java.util.List;

import javax.ejb.Local;

@Local
public interface AccountAgentLocal {
	//life cycle method
	public void save(Account persistentInstance);
	//life cycle method
	public void delete(Account persistentInstance);
	//life cycle method
	public Account update(Account detachedInstance);

	//return all Account records by acc_name as a List<Account>
	public List<Account> findByAccName(String acc_name);
	//return all Account records search by some part of acc_name as a List<Account>
	public List<Account> searchByAccName(String acc_name);
	//return all Account records by contact as a List<Account>
	public List<Account> findByContact(String contact);
	//return all Account records by phone as a List<Account>
	public List<Account> findByPhone(String phone);
	//return all Account records by email as a List<Account>
	public List<Account> findByEmail(String email);
	//return all Account records by date as a List<Account>
	public List<Account> findByDate(Date date);

	//return all Account records by acc_id as a Account class
	public Account findAccountById(Integer acc_id);
	//return all Account records as a list<Account> 
	public List<Account> findAll();
	
	//life cycle method(save)
	public void addAccount(String acc_name, String contact, String phone, String email, Date date);
	//life cycle method(update)
	public void updateAccount(Integer acc_id, String acc_name, String contact, String phone, String email, Date date);
	//life cycle method(delete)
	public void removeAccountById(Integer acc_id);
	
	//return number of AOC Records find by acc_id as a number
	public Integer findNumOfAOCRecordsByAcc_id(Integer acc_id);
	//check exist acc_name return a boolean
	public Boolean checkByAccName(String acc_name);
	//search acc_name by part of acc_name as List<String>
	public List<String> searchByAccNameRetrunAccName(String acc_name);
	
}
